<template>
  <v-layout column class="page">
    <v-flex class="row" xs12 v-if="!dismissedChanges">
      <v-card transition="slide-y-transition">
        <v-container>
          <v-layout fill-height>
            <v-flex xs12 align-end flexbox>
              <vue-markdown id="changes-block" :source="changes"></vue-markdown>
            </v-flex>
          </v-layout>
        </v-container>
        <v-card-actions>
          <v-spacer></v-spacer>
          <v-btn @click="dismissChanges()" flat color="primary">Dismiss</v-btn>
        </v-card-actions>
      </v-card>
    </v-flex>
    <v-flex class="row main-content" xs12>
      <h1>Linux Kernel CVEs</h1>
      <p>This is a simple project to track CVEs in the upstream linux kernel. Individual distro’s (RHEL, Debian, Ubuntu, etc) often do a good job of tracking CVEs for their own kernels but this information is lacking for the upstream kernel. This project aims to help out with this void. The output was generated automatically through a set of tools that has not been fully tested or made public yet.</p>
      <h3>Linux security note</h3>
      <p>Tracking, mitigating, and patching CVEs is just a small part of maintaining a secure kernel. Let me be clear, you can patch all known CVEs and still be vulnerable. Some risk can be mitigated through properly configuring your kernel/system. I suggest you visit the Kernel Self Protection Project and other kernel security pages for more information.</p>
      <h3>Accuracy</h3>
      <p>The bulk of the data is autogenerated or pulled from other open sources. While every effort is taken to ensure its accuracy, no promise of absolute accuracy can be made. If you think a CVE is missing or is not completely accurate, please fill out an issue to have the data looked at and changed. The eventual goal would be to have a community curated list of CVEs along with when the code was introduced and when it was fixed.</p>
      <h3>Development</h3>
      <p>This project is being actively maintained. To review the project, or contribute, please visit the GitHub repository.</p>
      <v-btn
        href="https://github.com/nluedtke/linux_kernel_cves"
      >Visit Us on GitHub</v-btn>
    </v-flex>
  </v-layout>
</template>

<script>
import axios from 'axios'

export default {
  data () {
    return {
      changes: '',
      dismissedChanges: false,
      errors: []
    }
  },
  created () {
    var changesUrl = this.$apiBaseUrl + 'CHANGES.md'
    axios.get(changesUrl)
      .then(response => {
      // JSON responses are automatically parsed.
        this.changes = response.data
      })
      .catch(e => {
        this.errors.push(e)
      })
  },
  methods: {
    dismissChanges () {
      this.dismissedChanges = true
    },
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.row {
  margin: 1em;
}
</style>
